using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class DepartmentMap : EntityTypeConfiguration<Department>
    {
        public DepartmentMap()
        {
            // Primary Key
            this.HasKey(t => t.departmentID);

            // Properties
            this.Property(t => t.departmentName)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Department");
            this.Property(t => t.departmentID).HasColumnName("departmentID");
            this.Property(t => t.departmentName).HasColumnName("departmentName");
            this.Property(t => t.createTime).HasColumnName("createTime");
        }
    }
}
